package com.sendinfo.xspring.ibatis;

import java.io.Serializable;
import java.util.List;

import com.sendinfo.xspring.ibatis.page.Page;
import com.sendinfo.xspring.ibatis.page.PageRequest;

/**   
*    
* 项目名称：xibatis   
* 类名称：BaseDao   
* 类描述：CURD操作基类   
* 创建人：余梦   
* 创建时间：2012-3-1 下午01:49:38   
* 修改人：余梦   
* 修改时间：2012-3-1 下午01:49:38   
* 修改备注：在原有基础上删除修改了常用的方法   
* @version    
*    
*/ 
public interface BaseDao<E,PK extends Serializable> {

	public static final String DEFAULT_BIZ  = "__defaultBiz";
	public static final String DELETE       = "DELETE";
	public static final int    DELETE_OP    = 4;
	public static final int    INSERT_OP    = 1;
	public static final String SELECT       = "SELECT";
	
	
	public static final String INSERT       = "INSERT";
	public static final String DELETE_BY_PK = "DELETE_BY_PK";
	public static final String SELECT_BY_PK = "SELECT_BY_PK";
	public static final String UPDATE_BY_PK = "UPDATE_BY_PK";
	public static final String SELECT_SEQ 	= "SELECT_SEQ";
	
	
	public static final String SELECT_COUNT = "SELECT_COUNT";
	public static final String UPDATE       = "UPDATE";
	public static final int    UPDATE_OP    = 2;
	
	//新增方法列表
	public void insert(E obj);
	public int insertBatch(String nameSpace, List<E> obj, String idPostfix);
	//删除方法列表
	public int delete(E obj);
	public int delete(E obj,boolean flag);
	public int deleteBatch(String nameSpace, List<E> obj, String idPostfix);
    
	//修改
	public void update(E obj);
	public int updateBatch(String nameSpace, List<E> obj, String idPostfix);
	
	//查询方法列表
	public E getById(PK id);
	public E getObj(String namaSpace, Object obj, String idPostfix);
	public List<E> getList(String nameSpace, Object obj, String idPostfix);
	public PK getNewId();
	public Long getSeq(String name);
	public Page<E> pageQuery(PageRequest<?> pageRequest, String idPostfix);
	
	
	
	
}
